Returns a value from a data source linked to an external datasheet based on a SQL scalar query.
Syntax
GetSQLScalar("DatasheetName", "SQLScalarQuery", FailureBehavior)
Arguments
| Argument | Description |
|---|---|
| DatasheetName | External datasheet to open. Must be in the current workspace and linked to a data source. |
| SQLScalarQuery | SQL scalar query to run. |
| FailureBehavior | Failure behavior. True stops the script if the query fails. False displays a warning and continues playback. |
Return value
| Value | Description |
|---|---|
| Value | Value in the first column of the first row from the resulting data set. |
| Null | Query failed. |
Example
numCustomers = GetSQLScalar("Clients", "SELECT COUNT(*) FROM Customers", True)